<% for column in Item.content_columns %>
<p>
  <b><%= column.human_name %>:</b> <%=h @item.send(column.name) %>
</p>
<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @item %> |
<%= link_to 'Back', :action => 'list' %>
<%= button_to 'Destroy', :action => 'destroy', :id => @item %>
<br>
<h2>Item Drops</h2>
    <table>
    <thead>
       <tr>
         <th>Character</th>
         <th>Raid</th>
         <th>Date</th>
       </tr>
    </thead>
    <tbody>
        <% for d in @item.item_drops %>
            <tr>
                <% if d.character %>
                <% if d.raid %>
    	       <td><%= link_to d.character.name, :controller => "characters", :action => "show", :id => d.character.id%></td>
    	       <td><%= link_to d.raid.name, :controller => "raids", :action => "show", :id => d.raid.id %></td>
    	       <td><%= datestamp(d.raid.startdate) %></td>
    	       <% else %>
    	       <td><%= "Error with raid: " + debug(d) %>
               <% end %>
               <% else %>
               <td><%= "Error with character: " + debug(d) %>
    	       <% end %>
	       </tr>
	   <% end %>
	</tbody>
  </table>


